/*
 * Created: 2022-09-03 11:56:33
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text, Image } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {
    src: string;
}
ProductImg.defaultProps = {} as Partial<IProps>;
function ProductImg(props: IProps) {
    const { className, style, src } = props;
    const localClassName = useClassName('ProductImg', className);
    return <RootImage className={localClassName} style={style} src={src} mode={'aspectFit'}></RootImage>;
}
export default React.memo(ProductImg as FC<IProps>);
const RootImage = styled(Image)`
    &.ProductImg {
        margin: auto;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: center;
        align-items: center;
    }
`;
